package com.cskaoyan.bean.vo;

import com.cskaoyan.bean.po.wxPo.MarketGoodsProduct;
import com.cskaoyan.util.StringToArrayUtils;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class WxGoodsProductVO {
    private Integer id;

    private Integer goodsId;

    private List<String> specifications;

    private BigDecimal price;

    private Integer number;

    private String url;

    private Date addTime;

    private Date updateTime;

    private Boolean deleted;

    public static WxGoodsProductVO getWxGoodsProductVO(MarketGoodsProduct marketGoodsProduct){
        WxGoodsProductVO wxGoodsProductVO = new WxGoodsProductVO();
        wxGoodsProductVO.setGoodsId(marketGoodsProduct.getGoodsId());
        wxGoodsProductVO.setId(marketGoodsProduct.getId());
        wxGoodsProductVO.setSpecifications(StringToArrayUtils.toStringList(marketGoodsProduct.getSpecifications()));
        wxGoodsProductVO.setPrice(marketGoodsProduct.getPrice());
        wxGoodsProductVO.setNumber(marketGoodsProduct.getNumber());
        wxGoodsProductVO.setUrl(marketGoodsProduct.getUrl());
        wxGoodsProductVO.setAddTime(marketGoodsProduct.getAddTime());
        wxGoodsProductVO.setUpdateTime(marketGoodsProduct.getUpdateTime());
        wxGoodsProductVO.setDeleted(marketGoodsProduct.getDeleted());
        return wxGoodsProductVO;
    }
}
